//- Copyright (c) 2016 Lucky Byte, Inc.
table.ui.celled.small.compact.table.very.basic.structured.nolayout
  tbody
    tr
      td.center.aligned(rowspan="5" style="width: 10px;") 基本信息
      td.right.aligned.collapsing 序 号
      td.collapsing.positive= record.serial
      td.right.aligned.collapsing UUID
      td.collapsing.positive(colspan="2")= record.uuid
      td.right.aligned.collapsing 平台/外联
      td.collapsing.positive= record.inside ? '平台商户' : '外联商户'
      td.right.aligned.collapsing 所属渠道
      td.collapsing.positive= constant.merch_chnls[record.chnl] || '未知'
      td.right.aligned.collapsing 创建时间
      td.positive(colspan="3")= record.ctime.format('YYYY-MM-DD HH:mm:ss')
    tr
      td.right.aligned.collapsing 商户编号
      td.collapsing.positive(colspan="4")= record.merno
      td.right.aligned.collapsing 商户名称
      td.collapsing.positive(colspan="3")= record.name
      td.right.aligned.collapsing 商户地址
      td.positive(colspan="3")= record.address
    tr
      td.right.aligned.collapsing 联系人
      td.collapsing.positive(colspan="2")= record.contact
      td.right.aligned.collapsing 联系电话
      td.collapsing.positive= record.telephone
      td.right.aligned.collapsing 联系手机
      td.collapsing.positive= record.mobile
      td.right.aligned.collapsing 传真号码
      td.collapsing.positive= record.fax
      td.right.aligned.collapsing 电子邮箱
      td.positive(colspan="3")= record.email
    tr
      td.right.aligned.collapsing 消费手续费
      td.collapsing.positive(colspan="12")
        if record.t20_fee
          | #{record.t20_fee_name} ｜ #{record.t20_fee_notes}
    tr
      td.right.aligned.collapsing 外联商户
      td.collapsing.positive(colspan="6")
        if record.mapto_merid
          | #{record.mapto_mer_name} ｜ #{record.mapto_mer_no}
      td.right.aligned.collapsing 虚拟清算户
      td.positive(colspan="5")
        if record.settl_merid
          | #{record.settl_mer_name} ｜ #{record.settl_mer_no}
    tr
      td.center.aligned(rowspan="4" style="width: 10px;") 交易控制
      td.right.aligned.collapsing 交易权限
      td.positive(colspan="12")
        if record.trctl
          each v, k in record.trctl.trcodes
            | #{constant.trctl_codes[k]}、
        else
          | 无
    tr
      td.right.aligned.collapsing(rowspan="3") 交易限制
      td.right.aligned.collapsing 消费交易
      td.positive(colspan="11")
        if record.trctl && record.trctl.t20
          | 交易时间：#{record.trctl.t20.time_begin || '不限'} － 
          | #{record.trctl.t20.time_end || '不限'}，
          | 单笔限额：#{fmtamt(record.trctl.t20.min_amt_per)} － 
          | #{fmtamt(record.trctl.t20.max_amt_per)}，
          | 分钟限额 / 限量：#{fmtamt(record.trctl.t20.max_amt_minute)} /
          | #{record.trctl.t20.max_cnt_minute || 0}，
          | 日限额 / 限量：#{fmtamt(record.trctl.t20.max_amt_day)} /
          | #{record.trctl.t20.max_cnt_day || 0}
        else
          | 无
    tr
      td.right.aligned.collapsing 助农取款
      td.positive(colspan="11")
        if record.trctl && record.trctl.t60
          | 交易时间：#{record.trctl.t60.time_begin || '不限'} － 
          | #{record.trctl.t60.time_end || '不限'}，
          | 单笔限额：#{fmtamt(record.trctl.t60.min_amt_per)} － 
          | #{fmtamt(record.trctl.t60.max_amt_per)}，
          | 分钟限额 / 限量：#{fmtamt(record.trctl.t60.max_amt_minute)} /
          | #{record.trctl.t60.max_cnt_minute || 0}，
          | 日限额 / 限量：#{fmtamt(record.trctl.t60.max_amt_day)} /
          | #{record.trctl.t60.max_cnt_day || 0}
        else
          | 无
    tr
      td.right.aligned.collapsing 商户代付
      td.positive(colspan="11")
        if record.trctl && record.trctl.tz0
          | 交易时间：#{record.trctl.tz0.time_begin || '不限'} － 
          | #{record.trctl.tz0.time_end || '不限'}，
          | 单笔限额：#{fmtamt(record.trctl.tz0.min_amt_per)} － 
          | #{fmtamt(record.trctl.tz0.max_amt_per)}，
          | 分钟限额 / 限量：#{fmtamt(record.trctl.tz0.max_amt_minute)} /
          | #{record.trctl.tz0.max_cnt_minute || 0}，
          | 日限额 / 限量：#{fmtamt(record.trctl.tz0.max_amt_day)} /
          | #{record.trctl.tz0.max_cnt_day || 0}
        else
          | 无

    tr
      td.center.aligned(rowspan="5") 公司资料
      td.right.aligned.collapsing 公司名称
      td.positive.collapsing(colspan="4")= record.unit_name
      td.right.aligned.collapsing 公司简称
      td.positive.collapsing= record.unit_name_abbr
      td.right.aligned.collapsing 公司英文名称
      td.positive.collapsing(colspan="3")= record.unit_english
      td.right.aligned.collapsing 公司英文简称
      td.positive(colspan="1")= record.unit_english_abbr
    tr
      td.right.aligned.collapsing 注册资本
      td.collapsing.positive(colspan="2") #{record.unit_assets} 万元
      td.right.aligned.collapsing 营业执照号码
      td.collapsing.positive(colspan="3")= record.unit_license
      td.right.aligned.collapsing 营业执照期止
      if record.unit_license_exp
        td.collapsing.positive= record.unit_license_exp.format('YYYY-MM-DD')
      else
        td.collapsing.positive
      td.right.aligned.collapsing 组织机构代码
      td.collapsing.positive= record.unit_code
      td.right.aligned.collapsing 税务登记代码
      td.positive(colspan="1")= record.unit_tax_code
    tr
      td.right.aligned.collapsing 企业性质
      td.collapsing.positive(colspan="2")= constant.unit_types[record.unit_type]
      td.right.aligned.collapsing 公司注册地址
      td.positive(colspan="5")= record.unit_address
      td.right.aligned.collapsing 发证机关名称
      td.positive(colspan="3")= record.unit_issuer
    tr
      td.right.aligned.collapsing 法人姓名
      td.collapsing.positive(colspan="2")= record.unit_legal_name
      td.right.aligned.collapsing 法人证件类型
      td.collapsing.positive= constant.cred_types[record.unit_cred_type]
      td.right.aligned.collapsing 法人证件号码
      td.positive(colspan="7")= record.unit_cred_no
    tr
      td.right.aligned.collapsing 经营范围
      td.positive(colspan="12")= record.unit_scope

    tr
      td.center.aligned(rowspan="3")

      td.right.aligned.collapsing 备 注
      td.positive(colspan="12")= record.notes

    if record.ex
      tr
        td.collapsing.right.aligned 最后修改人
        td.collapsing.positive(colspan="2")= record.input_user
        td.right.aligned.collapsing 最后修改时间
        td.collapsing.positive(
          colspan="1")= record.input_time.format('YYYY-MM-DD HH:mm:ss')
        td.right.aligned.collapsing 状 态
        if record.checked
          td.left.aligned.collapsing.positive 复核通过
          td.right.aligned.collapsing 复核人
          td.collapsing.positive(colspan="1")= record.check_user
          td.right.aligned.collapsing 复核时间
          td.positive(
            colspan="3")= record.check_time.format('YYYY-MM-DD HH:mm:ss')
        else if record.rejected
          td.left.aligned.collapsing.negative 复核拒绝
          td.right.aligned.collapsing 复核人
          td.collapsing.positive(colspan="1")= record.check_user
          td.right.aligned.collapsing 复核时间
          td.positive(
            colspan="3")= record.check_time.format('YYYY-MM-DD HH:mm:ss')
        else
          td.left.aligned.collapsing.positive(colspan="7") 等待复核

      if record.checked
        tr
          td.right.aligned.collapsing 预计生效时间
          td.positive(
            colspan="12")= record.effect_time.format('YYYY-MM-DD HH:mm:ss')
      else if record.rejected
        tr
          td.right.aligned.collapsing 拒绝原因
          td.negative(colspan="12")= record.reject_reason
    else
      tr
        td.collapsing.right.aligned 最后修改人
        td.collapsing.positive(colspan="2")= record.input_user
        td.right.aligned.collapsing 最后修改时间
        td.collapsing.positive(
          colspan="1")= record.input_time.format('YYYY-MM-DD HH:mm:ss')
        td.right.aligned.collapsing 复核人
        td.collapsing.positive(colspan="1")= record.check_user
        td.right.aligned.collapsing 复核时间
        td.collapsing.positive(
          colspan="2")= record.check_time.format('YYYY-MM-DD HH:mm:ss')
        td.right.aligned.collapsing 生效时间
        td.positive(
          colspan="2")= record.effect_time.format('YYYY-MM-DD HH:mm:ss')
